<?
$this->breadcrumbs = array($album->title);
?>
<section class="container">
	<div class="clearfix mb10">
		<?if($isAuthor):?>
		<ul class="about-panel">
			<li><a id="addPhoto" class="btn btn-small" href="<?=$this->createUrl('/album/upload', array('id' => $aid))?>" >添加图片</a></li>
			<li><a id="editPhoto" class="btn btn-small" href="<?=$this->createUrl('/album/upload', array('id' => $aid))?>" >整理图片</a></li>
		</ul>
		<?endif;?>
		<ul class="about-option">
			<li><i class="icon-eye-open"></i> <?=$album->views?> </li>
			<li><i class="icon-heart"></i> <?=$album->likes?> </li>
			<li><i class="icon-comment"></i> <?=$album->replies?> </li>
		</ul>
	</div>
	<div class="photo-list row unstyled">
		<?$this->widget('application.widgets.ListView', array(
			'id' => 'albumList',
			'dataProvider' => $albumDataProvider,
			'itemView' => '_albumList'
		)); ?>
	</div>
	<div class="row">
		<div class="span8">
			<div class="comment-list unstyled">
				<?$this->renderPartial('_albumComment', array(
					'commentDataProvider' => $commentDataProvider
				))?>
			</div>
			<?$form = $this->beginWidget('CActiveForm', array(
				'id' => 'albumComment'
			));?>
				<fieldset class="album-comment">
					<?if(Yii::app()->user->isGuest):?>
						<div class="control-group">
							<?=$form->labelEx($comment, 'author', array('class' => 'control-label')); ?>
		                    <div class="controls">
		                        <?=$form->textField($comment, 'author', array('class' => 'input-large')); ?>
		                        <?=$form->error($comment, 'author', array('class' => 'help-inline')); ?>
		                    </div>
						</div>
					<?endif;?>
					<div class="control-group">
						<?=$form->labelEx($comment, 'comment', array('class' => 'control-label')); ?>
	                    <div class="controls">
	                        <?=$form->textArea($comment, 'comment', array(
								'class' => 'span8',
								'placeholder' => Yii::t('album', '作品如何?')
							))?>
	                        <?=$form->error($comment, 'comment', array('class' => 'help-inline')); ?>
	                    </div>
					</div>
					<?=CHtml::submitButton('提交', array('id' => 'commentBtn', 'class' => 'btn btn-tall btn-wide btn-primary pull-right'))?>
				</fieldset>
			<?$this->endWidget()?>
		</div>
		<div class="span4">
			<ul></ul>
		</div>
	</div>
</section>
<?php 
$script = <<<EOF
Core.use('global', 'bootstrap-modal', 'dialog', function(){
	//表单提交时按钮不可以用
	var commentBtn = $('#commentBtn');
	commentBtn.click(function(){
		Core.Util.btnDisable(commentBtn);
	});
	//设置人性化时间
	Core.Util.updateTime($('time'));
	
	//调用upload dialog
	var addPhoto = $('#addPhoto');
	addPhoto.click(function(){
		$.dialog.open(addPhoto.attr('href'));
		return false;
	});
});
EOF;
Yii::app()->clientScript->registerScript($this->id, $script);
Yii::app()->clientScript->registerLessFile(Yii::getPathOfAlias('views.layouts.less.' . $this->module->id ) . '/' . $this->id . '.less');
?>